<script type="x-shader/x-fragment" id="particleVShader">
  
    #ifdef GL_ES
    precision highp float;
    #endif
    
	//Common
	attribute float size;
	attribute vec3 ca;
	attribute vec2 posxy;

	uniform float time;
	uniform vec2 img_size;

	varying vec3 vColor;

	void main() {

		vColor = ca;

		vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );

		//gl_PointSize = size;
		gl_PointSize = size * ( 300.0 / length( mvPosition.xyz ) );

		gl_Position = projectionMatrix * mvPosition;

		gl_Position.y += sin(posxy.x/img_size.x*2.0*3.14159+time/10000.0*2.0*3.14159)*10.0;
		gl_Position.x += sin(posxy.y/img_size.y*2.0*3.14159+time/10000.0*2.0*3.14159)*10.0;
		//gl_Position.z += sin(posxy.y/img_size.y*2.0*3.14159+time/10000.0*2.0*3.14159)*10.0;

		//gl_Position.x = cos(time/10000.0*2.0*3.14159)*gl_Position.x;
		//gl_Position.z = sin(time/10000.0*2.0*3.14159)*gl_Position.z;
	}
  
  </script>